package com.api.shopapi.mapper;

import com.api.shopapi.entity.ElderlyDisableLevelRel;
import com.api.shopapi.entity.ElderlyDiseaseTypeRel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ElderlyDisableLevelRelMapper {

    @Insert("insert into elderly_disable_level_rel " +
            "(" +
            "ElderlyDisableLevelRelCode," +
            "ElderlyCode," +
            "DisableLevelCode" +
            ") " +
            "values " +
            "(" +
            "#{elderlyDisableLevelRel.ElderlyDisableLevelRelCode}," +
            "#{elderlyDisableLevelRel.ElderlyCode}," +
            "#{elderlyDisableLevelRel.DisableLevelCode}" +
            ")" )
    int insert(@Param("elderlyDisableLevelRel") ElderlyDisableLevelRel elderlyDisableLevelRel);


    @Delete("delete from elderly_disable_level_rel where elderlyDisableLevelRelCode=#{elderlyDisableLevelRelCode}")
    int delete(@Param("elderlyDisableLevelRelCode") String elderlyDisableLevelRelCode);


    @Select("select * from elderly_disable_level_rel where elderlyCode=#{elderlyCode}")
    List<ElderlyDisableLevelRel> ListByElderlyCode(@Param("elderlyCode") String elderlyCode);


}
